﻿#include "InstructionThermostatDisconnect.h"

#include "ScriptRunner.h"
#include "TurnTableCodec.h"

__SCRIPTINSTRUCTION_REGISTER(InstructionThermostatDisconnect,ScriptInstruction::Instruction_Thermostat_Disconnect,&InstructionThermostatDisconnect::fromByteArray1);

InstructionThermostatDisconnect::InstructionThermostatDisconnect()
{
  instructionFlag = Instruction_Thermostat_Disconnect;
}

InstructionThermostatDisconnect::InstructionThermostatDisconnect(InstructionThermostatDisconnect const& instructionThermostatDisconnect)
{
  *this=instructionThermostatDisconnect;
}

InstructionThermostatDisconnect& InstructionThermostatDisconnect::operator=(InstructionThermostatDisconnect const & instructionThermostatDisconnect)
{
  *(ScriptInstruction*)this=instructionThermostatDisconnect;
  return *this;
}

InstructionThermostatDisconnect::~InstructionThermostatDisconnect()
{

}

void InstructionThermostatDisconnect::run()
{
  scriptRunner->sendInstruction(deviceId,TurnTableCodec::Thermostat_Disconnect);
  scriptRunner->scriptWaitAndRun(scriptRunner->getInterval_instruction(),deviceId);
}

QString InstructionThermostatDisconnect::toString()
{
  return QStringLiteral("断开温箱");
}

QByteArray InstructionThermostatDisconnect::toByteArray()
{
  return ScriptInstruction::toByteArray();
}

ScriptInstruction* InstructionThermostatDisconnect::fromByteArray1(char * const src,int size,int * offset)
{
  (void)src;
  (void)size;
  (void)offset;
  return new InstructionThermostatDisconnect();
}
